package com.example.bean;

import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;

/**
 * bean 实现接口实现初始化和销毁逻辑
 */
public class Cherry implements InitializingBean, DisposableBean {

    public Cherry() {
        System.out.println("Cherry constructor");
    }
    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("Cherry init");
    }

    @Override
    public void destroy() throws Exception {
        System.out.println("Cherry destroy");
    }
}
